package l1j.server.server.templates;

public class L1MagicDoll {

//	public static int getEffectByDoll(final L1Character _master, final byte type) { // 效果
//		final Collection<L1DollInstance> dolllist = _master.getDollList().getAllDolls();
//		if(dolllist == null || dolllist.isEmpty()){
//			return 0;
//		}
//		final int chance = Random.nextInt(100) + 1;
//		L1MagicDoll doll = null;
//		final Collection<L1DollInstance> _removeList = new ArrayList<L1DollInstance>();
//		_removeList.addAll(dolllist);
//		for (final L1DollInstance dolls : _removeList) {
//			doll = MagicDollTable.getInstance().getTemplate(dolls.getItemId());
//			if (doll != null) {
//				if (doll.getEffect() == type) {
//					if (chance <= 5) {
//						return type;
//					}
//				}
//			}
//		}
//		_removeList.clear();
//		return 0;
//	}

	private int _bowdmgChance;
	private int _itemId;
	private int _dollId;
	private int _ac;
	private int _hpr;// TODO 玩家體力回覆量
	private int _hprTime;// TODO 體力時間判斷可自行DB自行設定秒數
	private int _addHprByDoll;// TODO 魔法娃娃額外回血
	private int _mpr;// TODO 玩家魔力回覆量
	private int _mprTime;// TODO 魔力時間判斷可自行DB自行設定秒數
	private int _addMprByDoll; // TODO 魔法娃娃額外回魔
	private int _dmg;
	private int _bowDmg;
	private int _dmgChance;
	private int _hit;
	private int _bowHit;
	private int _dmgReduction;
	private int _dmgReductionChance;
	private int _dmgEvasionChance;
	private int _weightReduction;
	private int _registStun;
	private int _registStone;
	private int _registSleep;
	private int _registFreeze;
	private int _registSustain;
	private int _registBlind;
	private int _makeItemId;
	private int _makeItemTime;
	private byte _effect;
	private int _exprate_chance;// TODO 經驗機率發動by hot183
	private double _exprate;// TODO 經驗加乘效果by0968026609&原作者byhot183
	private int _Str;// TODO 魔法娃娃力量效果by0968026609
	private int _Con;// TODO 魔法娃娃體質效果by0968026609
	private int _Dex;// TODO 魔法娃娃敏捷效果by0968026609
	private int _cha;// TODO 魔法娃娃魅力效果by0968026609
	private int _Wis;// TODO 魔法娃娃精神效果by0968026609
	private int _Int;// TODO 魔法娃娃智力效果by0968026609
	private int _Wind;// TODO 魔法娃娃風屬性防禦by0968026609
	private int _water;// TODO 魔法娃娃水屬性防禦by0968026609
	private int _fire;// TODO 魔法娃娃火屬性防禦by0968026609
	private int _earth;// TODO 魔法娃娃地屬性防禦by0968026609
	private int _mr;// TODO 魔法娃娃魔法防禦

	/** 0=普通、1=不死系、2=惡魔系、3=BOSS系、4=亡靈系、5=狼人系、6=龍系 */
	private int _普通, _不死, _惡魔, _BOSS, _亡靈, _狼人, _龍, _人;

	private double _掉寶, _金幣;

	private int _地, _水, _火, _風;

	public int getAc() {
		return this._ac;
	}

	/**
	 * 魔法娃娃額外回血
	 *
	 * @return
	 */
	public int getAddHprByDoll() {
		return this._addHprByDoll;
	}

	/**
	 * 魔法娃娃額外回魔
	 *
	 * @return
	 */
	public int getAddMprByDoll() {
		return this._addMprByDoll;
	}

	public int getBOSS() {
		return this._BOSS;
	}

	public int getBowDmg() {
		return this._bowDmg;
	}

	public int getBowDmgChance() {
		return this._bowdmgChance;
	}

	public int getBowHit() {
		return this._bowHit;
	}

	/**
	 * 魔法娃娃魅力效果
	 *
	 * @return
	 */
	public int getCha() {
		return this._cha;
	}

	/**
	 * 魔法娃娃體質效果
	 *
	 * @return
	 */
	public int getCon() {
		return this._Con;
	}

	/**
	 * 魔法娃娃敏捷效果
	 *
	 * @return
	 */
	public int getDex() {
		return this._Dex;
	}

	public int getDmg() {
		return this._dmg;
	}

	public int getDmgChance() {
		return this._dmgChance;
	}

	public int getDmgEvasionChance() {
		return this._dmgEvasionChance;
	}

	public int getDmgReduction() {
		return this._dmgReduction;
	}

	public int getDmgReductionChance() {
		return this._dmgReductionChance;
	}

	public int getDollId() {
		return this._dollId;
	}

	/**
	 * 魔法娃娃地屬性防禦效果
	 *
	 * @return
	 */
	public int getearth() {
		return this._earth;
	}

	public byte getEffect() {
		return this._effect;
	}

	/**
	 * 經驗加乘效果
	 *
	 * @return byhot183
	 */
	public double getExpRate() {
		return this._exprate;
	}

	/**
	 * 經驗機率發動
	 *
	 * @author by hot183
	 */
	public int getExpRateChance() {
		return this._exprate_chance;
	}

	/**
	 * 魔法娃娃火屬性防禦效果
	 *
	 * @return
	 */
	public int getfire() {
		return this._fire;
	}

	public int getHit() {
		return this._hit;
	}

	/**
	 * 玩家體力回覆量
	 *
	 * @return
	 */
	public int getHpr() {
		return this._hpr;
	}

	/**
	 * 體力時間判斷可自行DB自行設定秒數
	 *
	 * @return
	 */
	public int getHprTime() {
		return this._hprTime;
	}

	/**
	 * 魔法娃娃智力效果
	 *
	 * @return
	 */
	public int getInt() {
		return this._Int;
	}

	public int getItemId() {
		return this._itemId;
	}

	public int getMakeItemId() {
		return this._makeItemId;
	}

	public int getMakeItemTime() {
		return this._makeItemTime;
	}

	/**
	 * 玩家魔力回覆量
	 *
	 * @return
	 */
	public int getMpr() {
		return this._mpr;
	}

	/**
	 * 魔力時間判斷可自行DB自行設定秒數
	 *
	 * @return
	 */
	public int getMprTime() {
		return this._mprTime;
	}

	/**
	 * 魔法娃娃魔法防禦
	 *
	 * @return
	 */
	public int getMr() {
		return this._mr;
	}

	/**
	 * 魔法娃娃魔法防禦
	 *
	 * @return
	 */
	public void getMr(final int i) {
		this._mr = i;
	}

	public int getRegistBlind() {
		return this._registBlind;
	}

	public int getRegistFreeze() {
		return this._registFreeze;
	}

	public int getRegistSleep() {
		return this._registSleep;
	}

	public int getRegistStone() {
		return this._registStone;
	}

	public int getRegistStun() {
		return this._registStun;
	}

	public int getRegistSustain() {
		return this._registSustain;
	}

	/**
	 * 魔法娃娃力量效果
	 *
	 * @return
	 */
	public int getStr() {
		return this._Str;
	}

	/**
	 * 魔法娃娃水屬性防禦效果
	 *
	 * @return
	 */
	public int getwater() {
		return this._water;
	}

	public int getWeightReduction() {
		return this._weightReduction;
	}

	/**
	 * 魔法娃娃風屬性防禦效果
	 *
	 * @return
	 */
	public int getWind() {
		return this._Wind;
	}

	/**
	 * 魔法娃娃精神效果
	 *
	 * @return
	 */
	public int getWis() {
		return this._Wis;
	}

	public int get人() {
		return this._人;
	}

	public int get亡靈() {
		return this._亡靈;
	}

	public int get不死() {
		return this._不死;
	}

	public int get水() {
		return this._水;
	}

	public int get火() {
		return this._火;
	}

	public int get地() {
		return this._地;
	}

	public double get金幣加倍() {
		return this._金幣;
	}

	public int get風() {
		return this._風;
	}

	public int get狼人() {
		return this._狼人;
	}

	public double get掉寶加倍() {
		return this._掉寶;
	}

	public int get惡魔() {
		return this._惡魔;
	}

	public int get普通() {
		return this._普通;
	}

	public int get龍() {
		return this._龍;
	}

	public void setAc(final int i) {
		this._ac = i;
	}

	/**
	 * 魔法娃娃額外回血
	 *
	 * @return
	 */

	public void setAddHprByDoll(final int i) {
		this._addHprByDoll = i;
	}

	/**
	 * 魔法娃娃額外回魔
	 *
	 * @return
	 */
	public void setAddMprByDoll(final int i) {
		this._addMprByDoll = i;
	}

	public void setBOSS(final int i) {
		this._BOSS = i;
	}

	public void setBowDmg(final int i) {
		this._bowDmg = i;
	}

	public void setBowDmgChance(final int i) {
		this._bowdmgChance = i;
	}

	public void setBowHit(final int i) {
		this._bowHit = i;
	}

	/**
	 * 魔法娃娃魅力效果
	 *
	 * @return
	 */

	public void setCha(final int i) {
		this._cha = i;
	}

	/**
	 * 魔法娃娃體質效果
	 *
	 * @return
	 */
	public void setCon(final int i) {
		this._Con = i;
	}

	/**
	 * 魔法娃娃敏捷效果
	 *
	 * @return
	 */

	public void setDex(final int i) {
		this._Dex = i;
	}

	public void setDmg(final int i) {
		this._dmg = i;
	}

	public void setDmgChance(final int i) {
		this._dmgChance = i;
	}

	public void setDmgEvasionChance(final int i) {
		this._dmgEvasionChance = i;
	}

	public void setDmgReduction(final int i) {
		this._dmgReduction = i;
	}

	public void setDmgReductionChance(final int i) {
		this._dmgReductionChance = i;
	}

	public void setDollId(final int i) {
		this._dollId = i;
	}

	/**
	 * 魔法娃娃地屬性防禦效果
	 *
	 * @return
	 */
	public void setEarth(final int i) {
		this._earth = i;
	}

	public void setEffect(final byte i) {
		this._effect = i;
	}

	/**
	 * 經驗加乘效果
	 *
	 * @return byhot183
	 */
	public void setExpRate(final double d) {
		this._exprate = d;
	}

	/**
	 * 經驗機率發動
	 *
	 * @author by hot183
	 */
	public void setExpRateChance(final int i) {
		this._exprate_chance = i;
	}

	/**
	 * 魔法娃娃火屬性防禦效果
	 *
	 * @return
	 */
	public void setFire(final int i) {
		this._fire = i;
	}

	public void setHit(final int i) {
		this._hit = i;
	}

	/**
	 * 玩家體力回覆量
	 *
	 * @return
	 */
	public void setHpr(final int i) {
		this._hpr = i;
	}

	/**
	 * 體力時間判斷可自行DB自行設定秒數
	 *
	 * @return
	 */
	public void setHprTime(final int i) {
		this._hprTime = i;
	}

	/**
	 * 魔法娃娃智力效果
	 *
	 * @return
	 */
	public void setInt(final int i) {
		this._Int = i;
	}

	public void setItemId(final int i) {
		this._itemId = i;
	}

	public void setMakeItemId(final int i) {
		this._makeItemId = i;
	}

	public void setMakeItemTime(final int i) {
		this._makeItemTime = i;
	}

	/**
	 * 玩家魔力回覆量
	 *
	 * @return
	 */
	public void setMpr(final int i) {
		this._mpr = i;
	}

	/**
	 * 魔力時間判斷可自行DB自行設定秒數
	 *
	 * @return
	 */
	public void setMprTime(final int i) {
		this._mprTime = i;
	}

	public void setRegistBlind(final int i) {
		this._registBlind = i;
	}

	public void setRegistFreeze(final int i) {
		this._registFreeze = i;
	}

	public void setRegistSleep(final int i) {
		this._registSleep = i;
	}

	public void setRegistStone(final int i) {
		this._registStone = i;
	}

	public void setRegistStun(final int i) {
		this._registStun = i;
	}

	public void setRegistSustain(final int i) {
		this._registSustain = i;
	}

	/**
	 * 魔法娃娃力量效果
	 *
	 * @return
	 */

	public void setStr(final int i) {
		this._Str = i;
	}

	/**
	 * 魔法娃娃水屬性防禦效果
	 *
	 * @return
	 */
	public void setWater(final int i) {
		this._water = i;
	}

	public void setWeightReduction(final int i) {
		this._weightReduction = i;
	}

	/**
	 * 魔法娃娃風屬性防禦效果
	 *
	 * @return
	 */
	public void setWind(final int i) {
		this._Wind = i;
	}

	/**
	 * 魔法娃娃精神效果
	 *
	 * @return
	 */
	public void setWis(final int i) {
		this._Wis = i;
	}

	public void set人(final int i) {
		this._人 = i;
	}

	public void set亡靈(final int i) {
		this._亡靈 = i;
	}

	public void set不死(final int i) {
		this._不死 = i;
	}

	public void set水(final int i) {
		this._水 = i;
	}

	public void set火(final int i) {
		this._火 = i;
	}

	public void set地(final int i) {
		this._地 = i;
	}

	public void set金幣加倍(final double d) {
		this._金幣 = d;
	}

	public void set風(final int i) {
		this._風 = i;
	}

	public void set狼人(final int i) {
		this._狼人 = i;
	}

	public void set掉寶加倍(final double d) {
		this._掉寶 = d;
	}

	public void set惡魔(final int i) {
		this._惡魔 = i;
	}

	public void set普通(final int i) {
		this._普通 = i;
	}

	public void set龍(final int i) {
		this._龍 = i;
	}
	
	private int[] _action;
	
	public void addAction(final int action){
		if(_action == null){
			_action = new int[2];
			_action[0] = action;
		}else{
			for(int i=0; i<_action.length; i++){
				if(_action[i]==0){
					_action[i] = action;
					break;
				}
			}
		}
	}
	public int[] getActionlist(){
		return _action;
	}
	
//	/** 娃娃增加遠距離傷害opqlo改寫 **/
//	public static void getBowDamageByDoll(final L1PcInstance _master,final L1DollInstance dollIns, final boolean out) {
//		int addDmgChance = _master.getBowDmgAddChanceByDoll(), addDmg = _master.getBowDmgAddByDoll();
//		L1MagicDoll doll = null;
//		if (!out) {
//			addDmgChance = 0;
//			doll = MagicDollTable.getInstance().getTemplate(dollIns.getItemId());
//			if (doll != null) {
//				addDmg -= doll.getBowDmg();
//			}
//			Collection<L1DollInstance> _removeList = new ArrayList<L1DollInstance>();
//			_removeList.addAll(_master.getDollList().values());
//			for (final L1DollInstance dolls : _removeList) {
//				doll = MagicDollTable.getInstance().getTemplate(dolls.getItemId());
//				if (doll != null) {
//					addDmgChance = Math.max(addDmgChance,doll.getBowDmgChance());
//				}
//			}
//			_removeList.clear();
//			_removeList = null;
//		} else {
//			doll = MagicDollTable.getInstance().getTemplate(dollIns.getItemId());
//			if (doll != null) {
//				addDmgChance = Math.max(addDmgChance, doll.getBowDmgChance());
//				addDmg += doll.getBowDmg();
//			}
//		}
//		_master.setBowDmgAddChanceByDoll(addDmgChance);
//		_master.setBowDmgAddByDoll(addDmg);
//
//	}
//	/** 娃娃增加傷害opqlo改寫 **/
//	public static void getDamageAddByDoll(final L1PcInstance _master,
//			final L1DollInstance dollIns, final boolean out) { // TODO 近接攻撃力増加
//		int addDmgChance = _master.getDmgAddChanceByDoll(), addDmg = _master
//				.getDmgAddByDoll();
//		L1MagicDoll doll = null;
//		if (!out) {
//			addDmgChance = 0;
//			doll = MagicDollTable.getInstance()
//					.getTemplate(dollIns.getItemId());
//			if (doll != null) {
//				addDmg -= doll.getDmg();
//			}
//			Collection<L1DollInstance> _removeList = new ArrayList<L1DollInstance>();
//			_removeList.addAll(_master.getDollList().values());
//			for (final L1DollInstance dolls : _removeList) {
//				doll = MagicDollTable.getInstance().getTemplate(
//						dolls.getItemId());
//				if (doll != null) {
//					addDmgChance = Math.max(addDmgChance, doll.getDmgChance());
//				}
//			}
//			_removeList.clear();
//			_removeList = null;
//		} else {
//			doll = MagicDollTable.getInstance()
//					.getTemplate(dollIns.getItemId());
//			if (doll != null) {
//				addDmgChance = Math.max(addDmgChance, doll.getDmgChance());
//				addDmg += doll.getDmg();
//			}
//		}
//		_master.setDmgAddChanceByDoll(addDmgChance);
//		_master.setDmgAddByDoll(addDmg);
//	}
	/*
	 * public static int getWindByDoll(final L1Character _master) {//TODO 風屬性防禦
	 * int s = 0; L1MagicDoll doll = null; for ( final L1DollInstance dollIns :
	 * _master.getDollList().values()) { doll =
	 * MagicDollTable.getInstance().getTemplate(dollIns.getItemId()); if (doll
	 * != null) { s += doll.getWind(); } } return s; }
	 *
	 * public static int getwaterByDoll(final L1Character _master) {//TODO 水屬性防禦
	 * int s = 0; L1MagicDoll doll = null; for ( final L1DollInstance dollIns :
	 * _master.getDollList().values()) { doll =
	 * MagicDollTable.getInstance().getTemplate(dollIns.getItemId()); if (doll
	 * != null) { s += doll.getwater(); } } return s; }
	 *
	 * public static int getfireByDoll(final L1Character _master) {//TODO 火屬性防禦
	 * int s = 0; L1MagicDoll doll = null; for ( final L1DollInstance dollIns :
	 * _master.getDollList().values()) { doll =
	 * MagicDollTable.getInstance().getTemplate(dollIns.getItemId()); if (doll
	 * != null) { s += doll.getfire(); } } return s; }
	 *
	 * public static int getearthByDoll(final L1Character _master) {//TODO 地屬性防禦
	 * int s = 0; L1MagicDoll doll = null; for ( final L1DollInstance dollIns :
	 * _master.getDollList().values()) { doll =
	 * MagicDollTable.getInstance().getTemplate(dollIns.getItemId()); if (doll
	 * != null) { s += doll.getearth(); } } return s; }
	 */

	/*
	 * public int getMakeItemId(final L1Character _master) { //TODO アイテム獲得 for (
	 * final L1DollInstance dollIns : _master.getDollList().values()) { final
	 * L1MagicDoll doll =
	 * MagicDollTable.getInstance().getTemplate(dollIns.getItemId()); if (doll
	 * != null) { final L1Item item =
	 * ItemTable.getInstance().getTemplate(doll.getMakeItemId()); if (item !=
	 * null) { return item.getItemId(); } } } return 0; }
	 */
}
